function distributionCalc(
    row,
    manPowerInput,
    constants,
    group_salary_cost,
    housing_fund_rate
) {
    let deptName = row.implement_department;
    let manPowerInputs = manPowerInput
        .filter(item => item.implement_department === deptName)
        .map(function(v) {
            return v.input;
        });

    // 当前部门投入总人月
    let sumManMonth = manPowerInputs
        .reduce(function(a, b) {
            return a.concat(b);
        }, [])
        .reduce(function(a, b) {
            return parseFloat(a || '0') + parseFloat(b || '0');
        }, 0);

    // 摊销单位合计
    const perDepreciation =
        parseFloat(constants.depreciation_rent || 0) +
        parseFloat(constants.depreciation_renovation || 0) +
        parseFloat(constants.depreciation_house || 0);

    // 薪资合计
    const perSalary = group_salary_cost[deptName];

    // 补贴
    const perAllowance = 396 + 176 + 462;

    // 计算
    let depreciation = sumManMonth * perDepreciation;
    let computers = (sumManMonth * 5500) / 36;
    let housing_funds = (perSalary * housing_fund_rate) / 100;
    let allowance = sumManMonth * perAllowance;
    let total = depreciation + computers + housing_funds + allowance + perSalary;

    console.table([
        { key: '部门', value: deptName },
        { key: '总人月', value: sumManMonth },
        { key: '房租及物业管理费摊销', value: constants.depreciation_rent },
        { key: '装修费摊销', value: constants.depreciation_renovation },
        { key: '房屋建筑物折旧', value: constants.depreciation_house },
        { key: '住房公积金比例', value: housing_fund_rate },
        { key: 'final: 摊销费用', value: depreciation },
        { key: 'final: 电脑折旧', value: computers },
        { key: 'final: 薪资', value: perSalary },
        { key: 'final: 公积金', value: housing_funds },
        { key: 'final: 补贴', value: sumManMonth * perAllowance },
        { key: 'final: 总计', value: total }
    ]);
    return total;
}

export { distributionCalc };
